home *** CD-ROM | disk | FTP | other *** search
- // ⌐ 2005 The Weather Channel Interactive, Inc. All Rights Reserved.
-
- function ConfigUpdateObserver(a) {
- this.observerName = a;
- }
-
- ConfigUpdateObserver.prototype = {
- funcObj : null,
-
- setFunction : function(f){
- this.funcObj = f;
- },
-
- observe : function(subject, topic, data) {
- // ADD CODE THAT DOES STUFF....
- //alert("NOTIFIED: " + subject + " " + topic + " " + data);
-
- if(typeof(this.funcObj) != "undefined"){
- this.funcObj(subject, topic, data);
- }
- },
-
- register : function() {
- var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- if(this.observerName){
- observerService.addObserver(this, this.observerName, false);
- }else{
- observerService.addObserver(this, "configupdate", false);
- }
- },
-
- unregister: function() {
- var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- if(this.observerName){
- observerService.removeObserver(this, this.observerName);
- }else{
- observerService.removeObserver(this, "configupdate");
- }
- }
- }
-